#include <iostream>
#include <numeric>
#include <string.h>
using namespace std;
char Compare(string s1,string s2);
void Sort(string &s);
int main()
{
	string s1,s2;
	getline(cin,s1,'\n');
	getline(cin,s2,'\n');
	Sort(s1);
	Sort(s2);
	cout<<Compare(s1,s2);
}
char Compare(string s1,string s2)
{
	int l1=s1.length();
	int l2=s2.length();
	bool find=false;
	char target;
	if(l1>l2){
		string temp=s1;
		s1=s2;
		s2=temp;
	}
	for(int i=0;i<l1;i++){
		if(s1[i]!=s2[i]){
			if(s2[i+1]==s1[i]){
				target=s2[i];
				find=true;
				break;
			}
		}
	}
	if(!find){
		target=s2[l1];
	}
	return target;
}
void Sort(string &s)
{
	for(int i=0;i<s.length()-1;i++){
		for(int j=0;j<s.length()-i-1;j++){
			if(s[j]>s[j+1]){
				char temp=s[j];
				s[j]=s[j+1];
				s[j+1]=temp;
			}
		}
	}
}
